import 'package:fish_redux/fish_redux.dart';
import '../../../app_files.dart';
import 'dart:convert' as convert;
import '../../FixOrderView/fix_result_page/state.dart';
import '../../MainView/model/main_view_model.dart';

class EngineerResultViewState implements Cloneable<EngineerResultViewState> {
  bool isDetail = false;
  FixResultModel model = FixResultModel(orderPhoto: []);
  bool isLoad = false;
  FixListItemModel itemModel;
  String remark = '';
  List logList =[];

  @override
  EngineerResultViewState clone() {
    return EngineerResultViewState()
      ..isDetail = isDetail
      ..remark = remark
      ..logList = logList
      ..itemModel = itemModel
      ..isLoad = isLoad
      ..model = model;
  }
}

EngineerResultViewState initState(Map<String, dynamic> args) {
  EngineerResultViewState state = EngineerResultViewState()
    ..isDetail = args['isDetail']
    ..itemModel = args['model'];
  if (!state.isDetail) {
    state.model.repairContent = args['repairContent'];
    state.model.repairPhotos = args['repairPhotos'];
    state.model.beforePhotos = args['beforePhotos'];
    state.model.beforeContent = args['beforeContent'];
    state.model.orderPhoto = args['orderPhotos'];
    state.model.signPhoto = args['signPhoto'];
  }

  return state;
}
